<template>
    <div class="cm-img-box" @click="handlerClick">
        <img :src="url" alt="" :style="{'width': width + 'px'}">
    </div>
</template>

<script>
export default {
    name: 'imgBox',
    data () {
        return {
        }
    },

    props: {
        url: {},
        width: {
            type: Number,
            default: 100
        }
    },

    methods: {
        handlerClick () {
            if (this.url) {
                this.$store.commit('changeShowImgBox', {
                    flag: true,
                    url: this.url
                })
            }
        }
    }
}
</script>

<style lang="scss">
    .cm-img-box {
    }
</style>
